﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter13.Code03.Code03.Snippet02
{
    public class Connection
    {
        public event EventHandler<MessageArriveEventArgs> MessageArrived;

        public string Name { get; set; }

        public void OnMessageArrived()
        {
            var messageArrived = MessageArrived;
            if (messageArrived != null)
            {
                messageArrived(this, new MessageArriveEventArgs());
            }
        }
    }
}
